<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:p="http://primefaces.org/ui"
       xmlns:cc="http://java.sun.com/jsf/composite">
	      
	     <!--INFERFACE-->
	     <cc:interface>  
	         <cc:attribute name="value" />  
	         <cc:attribute name="valueLabel" />
	         <cc:attribute name="converter" />  
	         <cc:attribute name="isFilter" />  
	         <cc:attribute name="size" /> 	  
	         <cc:attribute name="isSelectOne" />   
	         <cc:attribute name="listItems" /> 
	         <cc:attribute name="listItemLabel" />  
	         <cc:attribute name="listItemValue" />  
	         <cc:attribute name="isOnlyRead" />  
	     </cc:interface>  
	     
	     <!--IMPLEMENTATION--> 
	     <cc:implementation>  
	     
	        <p:outputPanel rendered="#{!cc.attrs.isFilter}" >
	        
	             <p:selectOneMenu 
	                              value="#{cc.attrs.value}" 
                                  converter="#{cc.attrs.converter}" 
                                  style="#{empty cc.attrs.size ? 'width:200px' : 
                                                                 'width:'.concat(cc.attrs.size).concat('px')}" 
                                  effect="fade"
                                  rendered="#{!cc.attrs.isOnlyRead}" >
	                                 
                    <f:selectItem itemLabel="#{cc.attrs.isSelectOne ? msg['cbx-value-selecione'] : 
                                                                      msg['cbx-value-todos']}" 
                                  itemValue="" />
                    <f:selectItems value="#{cc.attrs.listItems}" var="item"
                                   itemLabel="#{cc.attrs.listItemLabel}" 
                                   itemValue="#{cc.attrs.listItemValue}"/>
                    
				</p:selectOneMenu> 
				
	        
	        </p:outputPanel>
	        
	        <p:outputPanel rendered="#{cc.attrs.isFilter}" >
	        
	             <p:selectOneMenu value="#{cc.attrs.value}" 
	                              converter="#{cc.attrs.converter}" 
                                  filter="#{cc.attrs.isFilter}"                                                      
                                  filterMatchMode="contains" 
                                  style="#{empty cc.attrs.size ? 'width:200px' : 'width:'.concat(cc.attrs.size).concat('px')}" 
                                  effect="fade"
                                  rendered="#{!cc.attrs.isOnlyRead}" >
	                                 
                    <f:selectItem itemLabel="#{cc.attrs.isSelectOne ? msg['cbx-value-selecione'] : msg['cbx-value-todos']}" 
                                  itemValue="" />
                    <f:selectItems value="#{cc.attrs.listItems}" var="item"
                                   itemLabel="#{cc.attrs.listItemLabel}" 
                                   itemValue="#{cc.attrs.listItemValue}"/>
	           	</p:selectOneMenu>       
	        
	        </p:outputPanel>
	        
	        <h:outputText rendered="#{cc.attrs.isOnlyRead}" 
                          value="#{cc.attrs.valueLabel}"/>         
	        
	     </cc:implementation>  
     
 </html>     
